#if !defined(CINI)
#define CINI

#pragma once

class CIni 
{
public:
	CIni();
	CIni(TCHAR *strFileName);

	void GetAllSections(CStringArray *arr);
	TCHAR* GetValue(TCHAR * strSection,TCHAR * strKeyName, TCHAR * def = NULL);
	LONG   GetValue(TCHAR * strSection,TCHAR * strKeyName, LONG    def = 0);
	double GetValue(TCHAR * strSection,TCHAR * strKeyName, double  def = 0);
	DWORD  GetValue(TCHAR * strSection,TCHAR * strKeyName, DWORD   def = 0);

	BOOL SetValue(TCHAR * strSection,TCHAR * strKeyName, TCHAR * set);
	BOOL SetValue(TCHAR * strSection,TCHAR * strKeyName, LONG set);
	BOOL SetValue(TCHAR * strSection,TCHAR * strKeyName, double   set);
	BOOL SetValue(TCHAR * strSection,TCHAR * strKeyName, DWORD   set);

	BOOL DelKeyName(TCHAR * strSection,TCHAR * strKeyName);
	BOOL DelSection(TCHAR * strSection);
	virtual ~CIni();
private:
	TCHAR *m_strFileName;
	VOID InitstrFileName();
};

#endif 